﻿using System;

namespace _66_使泛型参数_泛型
{
    class Program
    {
        static void Main(string[] args)
        {
            Sample<string> tt1 = new Sample<string>();
            tt1.Work("hello");

            Sample<DateTime> tt2 = new Sample<DateTime>();
            tt2.Work(DateTime.Today);

            Sample<decimal> tt3 = new Sample<decimal>();
            tt3.Work(0.33M);

            Sample<float> tt4 = new Sample<float>();
            tt4.Work(11.954f);

            Sample<byte> tt5 = new Sample<byte>();
            tt5.Work(255);

            Sample<uint> tt6 = new Sample<uint>();
            tt6.Work(798652);

            Console.Read();
        }
    }

    public class Sample<K>
    {
        public void Work(K p)
        {
            Console.WriteLine($"{p.GetType().FullName,-20}:{p}");
        }
    }
}
